package com.bocek.chakmapoint.view.slideshow;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

import com.bocek.chakmapoint.controller.SlideshowController;

import java.awt.Color;

/**
 * Full screen slideshow window.
 * 
 * @author  Baris Sencan
 * @version 1.0
 */
public class SlideshowView extends JFrame {
	private static final long serialVersionUID = 3378629853102674929L;
	private static final SlideshowView instance = new SlideshowView();
	
	public static SlideshowView getInstance() {
		return instance;
	}

	/**
	 * Create the frame.
	 * 
	 * @requires Nothing.
	 * @modifies this contentPane
	 * @effects  Nothing.
	 */
	private SlideshowView() {
		super("ChakmaPoint 1.0 - By BOCEK Ltd.");
		
		addKeyListener(SlideshowController.getInstance());
		
		setAlwaysOnTop(true);
		setFocusable(true);
		setUndecorated(true);
		setResizable(false);
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setBounds(0, 0, screenSize.width, screenSize.height);
		
		setForeground(Color.WHITE);
		setBackground(Color.BLACK);
		getContentPane().setLayout(null);
		
		SlideshowPanel panel = SlideshowPanel.getInstance();
		getContentPane().add(panel);
		panel.setBounds(0, 0, screenSize.width, screenSize.height);
		
		SlideshowController.getInstance().setPanel(panel);
		SlideshowController.getInstance().drawSlide();
	}
}
